FROM php:8.2-fpm

RUN touch /etc/apt/sources.list.d/debian.sources

RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources
RUN apt update
RUN apt install -y git supervisor

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN install-php-extensions @composer
RUN install-php-extensions pdo_mysql
RUN install-php-extensions gd
RUN install-php-extensions zip-1.22.3
RUN install-php-extensions redis-6.0.2
RUN install-php-extensions mcrypt-1.0.7
RUN install-php-extensions xdebug-3.3.1
RUN install-php-extensions intl
RUN install-php-extensions bcmath
RUN install-php-extensions sockets

CMD ["php-fpm"]

RUN apt clean && rm -rf /var/lib/apt/lists/*
RUN supervisorctl reread
RUN supervisorctl update

EXPOSE 9000